package com.wc.算法基础课.E第五讲动态规划.数位统计DP.计数问题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/18 10:07
 * @description
 */
public class Main2 {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int a, b;
    static int N = 15;
    static int[] nums = new int[15];
    static int[] base = new int[10];
    static int[] rightNums = new int[10];

    public static void main(String[] args) {
        init();
        while (sc.hasNext()) {
            a = sc.nextInt();
            b = sc.nextInt();
            if (a == 0 && b == 0) {
                break;
            }
            if (a > b) {
                int tmp = a;
                a = b;
                b = tmp;
            }
            for (int i = 0; i < 10; i++) {
                out.print(dp(b, i) - dp(a - 1, i));
                out.print(' ');
            }
            out.println();
        }
        out.flush();
    }

    static void init() {
        base[0] = 1;
        for (int i = 1; i < 10; i++) base[i] = base[i - 1] * 10;
    }

    private static int dp(int n, int x) {
        if (n == 0) return 0;
        int len = 0;
        while (n != 0) {
            nums[len++] = n % 10;
            n /= 10;
        }
        rightNums[0] = 0;
        rightNums[1] = nums[0];
        for (int i = 1; i < len; i++) {
            rightNums[i + 1] = rightNums[i] + nums[i] * base[i];
        }
        int last = 0;
        int res = 0;
        for (int i = len - 1; i >= 0; i--) {
            int num = nums[i];
            res += last * base[i];
            if (x == 0) {
                res -= base[i];
            }
            if (num == x) {
                res += rightNums[i] + 1;
            }
            if (num > x) {
                res += base[i];
            }
            last = last * 10 + num;
        }

        return res;
    }

    static class FastReader {
        StringTokenizer st;
        BufferedReader br;

        FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        // 是否由下一个
        boolean hasNext() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = br.readLine();
                    if (line == null)
                        return false;
                    st = new StringTokenizer(line);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return true;
        }
    }

}
